From 1befd17d330edd54a5dc27d78f8faedde068c259 Mon Sep 17 00:00:00 2001 From: robertl Date: Mon, 2 Jul 2007 02:06:31 +0000 Subject: [PATCH] Let route simplifier know if it's working on tracks or routes so it knows which list to remove from. --- smplrout.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/smplrout.c b/smplrout.c index f3088766c..ec370aaa6 100644 --- a/smplrout.c +++ b/smplrout.c @@ -65,6 +65,7 @@ static char *countopt = NULL; static char *erroropt = NULL; static char *xteopt = NULL; static char *lenopt = NULL; +void (*waypt_del_fnp) (route_head *rte, waypoint *wpt); static arglist_t routesimple_args[] = { @@ -269,7 +270,7 @@ routesimple_tail( const route_head *rte ) totalerror += xte_recs[i].distance; } } - route_del_wpt( (route_head *)(void *)rte, + (*waypt_del_fnp)( (route_head *)(void *)rte, (waypoint *)(void *)(xte_recs[i].intermed->wpt)); waypt_free((waypoint *)(void *)(xte_recs[i].intermed->wpt)); @@ -299,7 +300,10 @@ routesimple_tail( const route_head *rte ) void routesimple_process( void ) { + waypt_del_fnp = route_del_wpt; route_disp_all( routesimple_head, routesimple_tail, routesimple_waypt_pr ); + + waypt_del_fnp = track_del_wpt; track_disp_all( routesimple_head, routesimple_tail, routesimple_waypt_pr ); } -- 2.30.2